package com.suzhiliang.springbootlesson.loggerInterceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Copyright (C), 2015-2018, XXX有限公司
 *
 * @ClassName: LoggerConfiguration
 * @Author: xmm
 * @Date: 2018/10/24 17:12
 * @Description: 设置视图渲染器
 * @Version 1.0
 */
@Configuration
public class LoggerConfiguration implements WebMvcConfigurer {
    //添加拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoggerInterceptor()).addPathPatterns("/**");
    }
}
